﻿/*
* Copyright (c) 2010-2012 Tesla Engine Group
* 
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* 
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/


using System;
using Tesla.Math;

namespace Tesla.Graphics {
    /// <summary>
    /// Interface representing a uniform parameter that is defined in an effect.
    /// </summary>
    public interface IEffectParameter {

        /// <summary>
        /// Gets the name of the parameter.
        /// </summary>
        String Name {
            get;
        }

        /// <summary>
        /// Gets the semantic of the parameter, if it exists.
        /// </summary>
        String Semantic {
            get;
        }

        /// <summary>
        /// Gets the array elements of the parameter, if it is an array.
        /// </summary>
        IEffectParameterCollection Elements {
            get;
        }

        /// <summary>
        /// Gets the structure members of the parameter, if it is a struct.
        /// </summary>
        IEffectParameterCollection StructureMembers {
            get;
        }

        /// <summary>
        /// Gets the collection of annotations that decorate the parameter.
        /// </summary>
        IEffectAnnotationCollection Annotations {
            get;
        }

        /// <summary>
        /// Gets the enumeration that specifies the parameter's classification.
        /// </summary>
        EffectParameterClass ParameterClass {
            get;
        }

        /// <summary>
        /// Gets the enumeration that specifies the parameter's type.
        /// </summary>
        EffectParameterType ParameterType {
            get;
        }

        /// <summary>
        /// Gets the number of columns in the class of this parameter.
        /// </summary>
        int ColumnCount {
            get;
        }

        /// <summary>
        /// Gets the number of rows in the class of this parameter.
        /// </summary>
        int RowCount {
            get;
        }

        /// <summary>
        /// Gets the value of the parameter as a bool.
        /// </summary>
        /// <returns>Bool value</returns>
        bool GetValueBoolean();

        /// <summary>
        /// Gets the value of the parameter as an array of bools.
        /// </summary>
        /// <param name="count">Number of elements to get</param>
        /// <returns>The bool array</returns>
        bool[] GetValueBooleanArray(int count);

        /// <summary>
        /// Gets the value of the parameter as a single.
        /// </summary>
        /// <returns>The single value</returns>
        float GetValueSingle();

        /// <summary>
        /// Gets the value of the parameter as an array of singles.
        /// </summary>
        /// <param name="count">Number of elements to get</param>
        /// <returns>The single array</returns>
        float[] GetValueSingleArray(int count);

        /// <summary>
        /// Gets the value of the parameter as an int.
        /// </summary>
        /// <returns>The int value</returns>
        int GetValueInt();

        /// <summary>
        /// Gets the value of the parameter as an array of ints.
        /// </summary>
        /// <param name="count">Number of elements to get</param>
        /// <returns>The int array</returns>
        int[] GetValueIntArray(int count);

        /// <summary>
        /// Gets the value of the parameter as a matrix.
        /// </summary>
        /// <returns>The matrix value</returns>
        Matrix GetValueMatrix();
        
        /// <summary>
        /// Gets the value of the parameter as an array of matrices.
        /// </summary>
        /// <param name="count">Number of elements to get</param>
        /// <returns>The matrix array</returns>
        Matrix[] GetValueMatrixArray(int count);

        /// <summary>
        /// Gets the value of the parameter as a matrix transpose.
        /// </summary>
        /// <returns>The matrix transpose value</returns>
        Matrix GetValueMatrixTranspose();

        /// <summary>
        /// Gets the value of the parameter as an array of matrix transposes.
        /// </summary>
        /// <param name="count">Number of elements to get</param>
        /// <returns>The matrix transpose array</returns>
        Matrix[] GetValueMatrixTransposeArray(int count);

        /// <summary>
        /// Gets the value of the parameter as a quaternion.
        /// </summary>
        /// <returns>The quaternion value</returns>
        Quaternion GetValueQuaternion();

        /// <summary>
        /// Gets the value of the parameter as an array of quaternions.
        /// </summary>
        /// <param name="count">Number of elements to get</param>
        /// <returns>The quaternion array</returns>
        Quaternion[] GetValueQuaternionArray(int count);

        /// <summary>
        /// Gets the value of the parameter as a RGBA color.
        /// </summary>
        /// <returns>The RGBA color value</returns>
        Color GetValueColor();

        /// <summary>
        /// Gets the value of the parameter as an array of RGBA colors.
        /// </summary>
        /// <param name="count">Number of elements to get</param>
        /// <returns>The quaternion array</returns>
        Color[] GetValueColorArray(int count);

        /// <summary>
        /// Gets the value of the parameter as a vector2.
        /// </summary>
        /// <returns>The vector2 value</returns>
        Vector2 GetValueVector2();

        /// <summary>
        /// Gets the value of the parameter as an array of vector2's.
        /// </summary>
        /// <param name="count">Number of elements to get</param>
        /// <returns>The vector2 array</returns>
        Vector2[] GetValueVector2Array(int count);

        /// <summary>
        /// Gets the value of the parameter as a vector3.
        /// </summary>
        /// <returns>The vector3 value</returns>
        Vector3 GetValueVector3();

        /// <summary>
        /// Gets the value of the parameter as an array of vector3's.
        /// </summary>
        /// <param name="count">Number of elements to get</param>
        /// <returns>The vector3 array</returns>
        Vector3[] GetValueVector3Array(int count);

        /// <summary>
        /// Gets the value of the parameter as a vector4.
        /// </summary>
        /// <returns>The vector4 value</returns>
        Vector4 GetValueVector4();

        /// <summary>
        /// Gets the value of the parameter as an array of vector4's.
        /// </summary>
        /// <param name="count">Number of elements to get</param>
        /// <returns>The vector4 array</returns>
        Vector4[] GetValueVector4Array(int count);

        /// <summary>
        /// Gets the value of the parameter as a String.
        /// </summary>
        /// <returns>The string value</returns>
        String GetValueString();

        /// <summary>
        /// Gets the value of the parameter as a Texture1D.
        /// </summary>
        /// <returns>The texture value</returns>
        Texture1D GetValueTexture1D();

        /// <summary>
        /// Gets the value of the parameter as a Texture2D.
        /// </summary>
        /// <returns>The texture value</returns>
        Texture2D GetValueTexture2D();

        /// <summary>
        /// Gets the value of the parameter as a Texture3D.
        /// </summary>
        /// <returns>The texture value</returns>
        Texture3D GetValueTexture3D();

        /// <summary>
        /// Gets the value of the parameter as a TextureCube.
        /// </summary>
        /// <returns>The texture value</returns>
        TextureCube GetValueTextureCube();

        /// <summary>
        /// Gets the value of the parameter as an array of textures.
        /// </summary>
        /// <param name="count">Number of elements to get</param>
        /// <returns>Texture array</returns>
        Texture[] GetValueTextureArray(int count);

        /// <summary>
        /// Sets the value of the parameter.
        /// </summary>
        /// <param name="value">Bool value</param>
        void SetValue(bool value);

        /// <summary>
        /// Sets the value of the parameter's elements.
        /// </summary>
        /// <param name="values">Array of bools</param>
        void SetValue(bool[] values);

        /// <summary>
        /// Sets the value of the parameter.
        /// </summary>
        /// <param name="value">Single value</param>
        void SetValue(float value);

        /// <summary>
        /// Sets the value of the parameter's elements.
        /// </summary>
        /// <param name="values">Array of singles</param>
        void SetValue(float[] values);

        /// <summary>
        /// Sets the value of the parameter.
        /// </summary>
        /// <param name="value">Int value</param>
        void SetValue(int value);

        /// <summary>
        /// Sets the value of the parameter's elements.
        /// </summary>
        /// <param name="values">Array of ints</param>
        void SetValue(int[] values);

        /// <summary>
        /// Sets the value of the parameter.
        /// </summary>
        /// <param name="value">Matrix value</param>
        void SetValue(Matrix value);

        /// <summary>
        /// Sets the value of the parameter's elements.
        /// </summary>
        /// <param name="values">Array of matrices</param>
        void SetValue(Matrix[] values);

        /// <summary>
        /// Sets the value of the parameter.
        /// </summary>
        /// <param name="value">Matrix transpose value</param>
        void SetValueTranspose(Matrix value);

        /// <summary>
        /// Sets the value of the parameter's elements.
        /// </summary>
        /// <param name="values">Array of transposed matrices</param>
        void SetValueTranspose(Matrix[] values);

        /// <summary>
        /// Sets the value of the parameter.
        /// </summary>
        /// <param name="value">Vector2 value</param>
        void SetValue(Vector2 value);

        /// <summary>
        /// Sets the value of the parameter's elements.
        /// </summary>
        /// <param name="values">Array of Vector2</param>
        void SetValue(Vector2[] values);

        /// <summary>
        /// Sets the value of the parameter.
        /// </summary>
        /// <param name="value">Vector3 value</param>
        void SetValue(Vector3 value);

        /// <summary>
        /// Sets the value of the parameter's elements.
        /// </summary>
        /// <param name="values">Array of Vector3</param>
        void SetValue(Vector3[] values);

        /// <summary>
        /// Sets the value of the parameter.
        /// </summary>
        /// <param name="value">Vector4 value</param>
        void SetValue(Vector4 value);

        /// <summary>
        /// Sets the value of the parameter's elements.
        /// </summary>
        /// <param name="values">Array of Vector4</param>
        void SetValue(Vector4[] values);

        /// <summary>
        /// Sets the value of the parameter.
        /// </summary>
        /// <param name="value">Quaternion value</param>
        void SetValue(Quaternion value);

        /// <summary>
        /// Sets the value of the parameter's elements.
        /// </summary>
        /// <param name="values">Array of quaternions</param>
        void SetValue(Quaternion[] values);

        /// <summary>
        /// Sets the value of the parameter.
        /// </summary>
        /// <param name="value">Color value (interpreted as a 4-float vector)</param>
        void SetValue(Color value);

        /// <summary>
        /// Sets the value of the parameter's elements.
        /// </summary>
        /// <param name="values">Array of color (interpreted as a 4-float vector)</param>
        void SetValue(Color[] values);

        /// <summary>
        /// Sets the value of the parameter.
        /// </summary>
        /// <param name="value">Texture value</param>
        void SetValue(Texture value);

        /// <summary>
        /// Sets the value of the parameter's elements.
        /// </summary>
        /// <param name="values">Array of textures</param>
        void SetValue(Texture[] values);
    }
}
